home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Archives
/
Timing
/
BigTimeV1_1.lha
/
bigtime
/
bin
/
user
/
UserTemplate.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-10-19
|
2KB
|
87 lines
/* --------------------------------------------------------------------------- */
/* Name: UserTemplate.c
* Author: aleph NULL (Silicon Based Life)
* Date: 8/10/95
* Comment: (c) Copyright 1995 Silicon Based Life
* :
*/
/* --------------------------------------------------------------------------- */
/* #includes */
#include <exec/ports.h>
#include <exec/types.h>
#include <clib/exec_protos.h>
#include "UserTemplate.h"
#include "UserTemplate_protos.h"
/* --------------------------------------------------------------------------- */
/* main */
main( int argc, char **argv )
{
struct MsgPort *mp = NULL;
struct UserMessage *um = NULL;
BOOL Done = FALSE;
if(!( mp = CreateMsgPort() ))
goto Exception;
mp->mp_Node.ln_Name = DEFAULT_USER_PORT;
mp->mp_Node.ln_Pri = 50;
AddPort( mp );
if(!( InitUserClock() ))
goto Exception;
while(! Done )
{
WaitPort( mp );
while( um = (struct UserMessage *)GetMsg( mp ) )
{
switch( um->um_Event )
{
case OPENFACE:
OpenUserClock();
break;
case CLOSEFACE:
CloseUserClock();
break;
case CHIME:
ChimeUserClock();
break;
case ALARM:
AlarmUserClock();
break;
case TIME:
UpdateUserClock();
break;
case PREFS:
OpenUserClockPrefs();
break;
case QUIT:
Done = TRUE;
break;
}
ReplyMsg( (struct Message *)um );
}
}
Exception:
FreeUserClock();
if( mp )
{
RemPort( mp );
while( um = (struct UserMessage *)GetMsg( mp ) )
ReplyMsg( (struct Message *)um );
DeleteMsgPort( mp );
}
exit(0);
}
/* --------------------------------------------------------------------------- */